﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SlamCms.SharePoint.Data
{
	public static class Queries
	{
		public static class TagField
		{
			public static string ClearContentItemTags
			{
				get
				{
					return "delete from ContentItemTag where ContentItemId = '{0}'";
				}
			}

			public static string GetContentItemTags
			{
				get
				{
					return "select ContentItemId, TagId from ContentItemTag where ContentItemId = '{0}'";
				}
			}

			public static string InsertContentItem
			{
				get
				{
					return @"begin
								if not exists(select 1 from ContentItemTag where ContentItemID = '{0}' and TagID = '{1}')
								insert into ContentItemTag 
								select '{0}', '{1}'
							end";
				}
			}
		}
	}
}
